/**
 * 
 */
package org.bf.sms.webservice;

import javax.xml.ws.Endpoint;

import org.apache.log4j.Logger;
import org.bf.sms.config.SysConfig;


/**
 * WebService 对外启动应用
 * 
 * @author LiuChang
 * @version 1.0
 * @since 1.0
 */
public class WebServiceApp
{
	/** log4j */
	private static final Logger logger = Logger.getLogger(WebServiceApp.class);

	/** service startup */
	public static void startUp()
	{

		// test code -- show in console
		System.out.println("web service start"); //$NON-NLS-1$

		// log
		WebServiceApp.logger.debug("web service start"); //$NON-NLS-1$

		// 初始化SMS' WebService
		SMSServerImpl implementor = new SMSServerImpl();

		// Creates and publishes an EndPoint for the specified implementor
		// object at the given address.
		Endpoint.publish(SysConfig.WS_ADDRESS, implementor);

		// test code -- show in console
		System.out.println("web service started"); //$NON-NLS-1$

		// log
		WebServiceApp.logger.debug("web service started"); //$NON-NLS-1$
	}

	/**
	 * WebService服务启动测试
	 * 
	 * @param args
	 */
	public static void main(String[] args)
	{
		System.out.println("web service start"); //$NON-NLS-1$
		SMSServerImpl implementor = new SMSServerImpl();
		String address = "http://localhost:9090/sms";//$NON-NLS-1$
		Endpoint.publish(address, implementor);
		System.out.println("web service started");//$NON-NLS-1$
	}
}